#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int checkMine(int choice1, int choice2, int p, struct gameState *state) {

	int r, coinCount;

	updateCoins(p, state, 0);
	coinCount = state->coins;
	
	zzzMineCardPlay(choice1, choice2, p, state, 0);
	assert(r == 0);

	updateCoins(p, state, 0);

	if (choice1 == choice2) {
		assert(coinCount == state->coins);
	}
	else {
		assert(coinCount + 1 == state->coins);
	}

	return 0;
}

int main() {

	int r, p, choice1, choice2, handCount;
	int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};

	struct gameState G;

	for (p = 0; p < 2; p++) {
		for (choice1 = copper; choice1 <= gold; choice1++) {
			for (choice2 = choice1; choice2 <= gold; choice2++) {
				for (handCount = 1; handCount < 10; handCount++) {
					memset(&G, 23, sizeof(struct gameState));
					r = initializeGame(2, k, 1, &G);
					G.handCount[p] = handCount;
					memset(G.hand[p], 0, sizeof(int) * handCount);
					checkMine(choice1, choice2, p, &G);
				}
			}
		}
	}

}
